package com.ysyx.ysyx_driverorderquery.controller;


import com.ysyx.ysyx_driverorderquery.dto.BaseDto;
import com.ysyx.ysyx_driverorderquery.service.OrderPojoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import java.text.ParseException;

/**
 * Created by IntelliJ IDEA.
 *
 * @description: xxxx接口/类
 * @author:薛宇晖
 * @create:2023/4/17 15:14
 */
@RestController
public class OrderController {

    @Autowired
    private OrderPojoService orderPojoService;


    @RequestMapping(value = "/driver/getOrderInfo/{orderId}",method = RequestMethod.GET)
    public BaseDto getOrderinfo(@PathVariable String orderId) throws ParseException {
        System.out.println(orderId);
        BaseDto baseDto = orderPojoService.queryOrderinfo(orderId);
        return baseDto;

    }

    @RequestMapping(value = "/driver/queryDoingOrder/{driverId}",method = RequestMethod.GET)
    public BaseDto getDoingOrder(@PathVariable int driverId) throws ParseException {

        return orderPojoService.queryDoingOrder(driverId);

    }


}
